using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace FrameWork.Source.Texture
{
    class CTexture
    {
        /// <summary>
        /// Sprite batch instance using for draw image
        /// </summary>
        SpriteBatch m_pSpriteHandler;

        /// <summary>
        /// Texture 2D instance , hold an image information
        /// </summary>
        Texture2D m_pImage;


        /// <summary>
        /// Constructor of this class
        /// </summary>
        public CTexture()
        {
            m_pImage = null;
            m_pSpriteHandler = null;
        }

        /// <summary>
        /// Load an image for this texture
        /// </summary>
        /// <param name="pImage">A pointer to a texture2D instance</param>
        /// <param name="pSpriteHandler">A pointer to a sprite batch instance</param>
        public void loadImage(Texture2D pImage, SpriteBatch pSpriteHandler)
        {
            m_pImage = pImage;
            m_pSpriteHandler = pSpriteHandler;
        }


        


        /// <summary>
        /// Draw a sprite image
        /// </summary>
        /// <param name="position"> position of the image on screen </param>
        public void drawImage(Vector2 position, Color color)
        {
            m_pSpriteHandler.Draw(m_pImage, position, color );
        }

        /// <summary>
        /// Draw a sprite image
        /// </summary>
        /// <param name="position">position of the image on screen</param>
        /// <param name="deep">deep of an image ( 0 = front , 1 = back )</param>
        public void drawImage(Vector2 position, float deep , Rectangle recSource , float alpha , Color color , float angle , Vector2 vecOrigin , Vector2 vecScale , SpriteEffects effect)
        {
            m_pSpriteHandler.Draw(m_pImage, position, recSource, color * alpha, MathHelper.ToRadians(angle), vecOrigin, vecScale, effect, deep);
        }
    }
}
